<!--!
This file is a part of MediaDrop (http://www.mediadrop.net),
Copyright 2009-2013 MediaCore Inc., Felix Schwarz and other contributors.
For the exact contribution history, see the git revision log.
The source code contained in this file is licensed under the GPLv3 or
(at your option) any later version.
See LICENSE.txt in the main project directory, for more information.
-->

<fieldset xmlns="http://www.w3.org/1999/xhtml"
          xmlns:py="http://genshi.edgewall.org/"
          id="${id}"
          class="${css_class}"
          py:attrs="attrs" >
	<legend py:content="legend" />
	<div class="fielderror" py:if="error and show_error" py:content="error" />
	<div py:if="hidden_fields">
		<div py:for="field in hidden_fields"
		     py:with="error=error_for(field)"
		     py:strip="True">
			<span py:replace="field.display(value_for(field), **args_for(field))" />
			<span py:if="show_children_errors and error and not field.show_error"
			      class="fielderror" py:content="error" />
		</div>
	</div>
	<ul class="field_list" py:attrs="list_attrs">
		<li py:for="i, field in enumerate(fields)"
		    id="${field.id}_container"
		    class="${i%2 and 'odd' or 'even'}"
		    title="${hover_help and help_text or ''}"
		    py:attrs="args_for(field).get('container_attrs') or field.container_attrs"
		    py:with="required = [None,' required'][int(field.is_required)];
		             error = error_for(field);
		             label_text = field.label_text and field.label_text and _(field.label_text) or None;
		             help_text = field.help_text and _(field.help_text) or None;" >
			<label py:if="show_labels and label_text and not field.suppress_label" id="${field.id}_label" for="${field.id}"
			       class="fieldlabel${required}" py:content="label_text" />
			${field.display(value_for(field), **args_for(field))}
			<a py:if="field.name == 'feed.itunes_url'" class="fieldhelp" href="https://phobos.apple.com/WebObjects/MZFinance.woa/wa/publishPodcast" target="_blank">Get an iTunes URL</a>
			<a py:if="field.name == 'feed.feedburner_url'" class="fieldhelp" href="http://feedburner.com/" target="_blank">Get a Feedburner URL</a>
			<span py:if="help_text and not hover_help" class="fieldhelp" py:content="help_text" />
			<span py:if="show_children_errors and error and not field.show_error" class="fielderror" py:content="error" />
		</li>
	</ul>
	<span py:if="error and not error.error_dict" class="fielderror" py:content="error" />
</fieldset>
